<?php
namespace app\assets;

use yii\web\AssetBundle;

/**
 * LazyLoad组件
 *
 * Class LazyLoadAsset
 * @package app\assets
 */
class LazyLoadAsset extends AssetBundle
{
    public $sourcePath = '@app/themes/basic/assets';
    public $js = [
        'js/jquery_lazyload/jquery.lazyload.min.js',
    ];
    public $depends = [
        'yii\web\JqueryAsset'
    ];

    /**
     * @inheritdoc
     */
    public static function register($view)
    {
        $view->registerJs('$("img.f-lazy").lazyload({effect:"fadeIn"});');
        return parent::register($view);
    }
}